import store from './store'
// 封装useDispatch和useSelector
// 目的: 就是为了使用这两个hook的时候不用再传递类型了
import { useSelector, TypedUseSelectorHook, useDispatch } from 'react-redux'
type RootState = ReturnType<typeof store.getState>
type AppDispatch = typeof store.dispatch
export const useAppSelector: TypedUseSelectorHook<RootState> = useSelector
export const useAppDispatch = () => useDispatch<AppDispatch>()
